<template>
	<view>
		<view v-if="hot" class="display">
			<view class="image" v-if="index > 12" v-for="(n,index) in images">
				<image lazy-load="true" mode="aspectFit"
					@click="clickimage(dns+n.imageurl)"
					v-bind:src="dns+n.imageurl" show-menu-by-longpress="true"></image>
			</view>
		</view>
		<view v-if="douyin" class="display">
						<view v-if="dns!=''" class="image" v-for="index of 82">
							<image lazy-load="true" ref="background" mode="aspectFit"
								@click="clickimage(dns+'douyin/douyin%20('+(index+1)+').jpg')"
								
								v-bind:src="dns+'douyin/douyin%20('+(index+1)+').jpg'" show-menu-by-longpress="true"></image>
						</view>
						<uni-load-more :status="more"></uni-load-more>
					</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				images:[],
				hot:false,
				dns:'',
				douyin:false
			}
		},
		methods: {
			clickimage: function(imageurl) {
				uni.navigateTo({
					url: '../detail/detail?imageurl=' + imageurl
				});
			},
		},
		onLoad(option) {
			var that=this
			that.dns=that.$dns
			if(option.category=="hot"){
				that.hot=true
				uni.request({
					url: $springboot+'admin/queryallhot',
					success(res) {
						that.images = res.data
					}
				})
			}else if(option.category=="douyin"){
				that.douyin=true
			}
		}
	}
</script>

<style>
	.display {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: space-evenly;
	}

	.image {
		width: 25%;
		zoom: 0.3;
		border-radius: 10px;
		overflow: hidden;
	}
</style>
